package game.editer.ui;

import game.editer.view.CreateEffectPreviewView;
import game.editer.config.HitDataConfig;
import hx.events.MouseEvent;

/**
 * 时间轴编辑支持
 */
class TimelineInput extends BaseAttributeInput {
	var button = new Button();

	override function onInit() {
		super.onInit();
		button.text = "编辑";
		button.width = 80;
		button.addEventListener(MouseEvent.CLICK, (e) -> {
			EditerStage.timeline.showEffectDataTimeline(this.value);
		});
		this.addChild(button);
		var delete = new CommonButton("UIAtlas:trash");
		this.addChild(delete);
		delete.addEventListener(MouseEvent.CLICK, (e) -> {
			this.value.frames = [];
			EditerStage.timeline.showEffectDataTimeline(null);
		});
	}

	override function set_value(value:Dynamic):Dynamic {
		return super.set_value(value);
	}
}
